import 'package:gluz/generated/json/base/json_convert_content.dart';
import 'package:gluz/app/data/auth_entity.dart';

AuthEntity $AuthEntityFromJson(Map<String, dynamic> json) {
  final AuthEntity authEntity = AuthEntity();
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    authEntity.userId = userId;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    authEntity.avatar = avatar;
  }
  final String? nickName = jsonConvert.convert<String>(json['nickName']);
  if (nickName != null) {
    authEntity.nickName = nickName;
  }
  final String? phoneNumber = jsonConvert.convert<String>(json['phoneNumber']);
  if (phoneNumber != null) {
    authEntity.phoneNumber = phoneNumber;
  }
  final String? type = jsonConvert.convert<String>(json['type']);
  if (type != null) {
    authEntity.type = type;
  }
  final String? authStatus = jsonConvert.convert<String>(json['authStatus']);
  if (authStatus != null) {
    authEntity.authStatus = authStatus;
  }
  final AuthPurchaser? purchaser = jsonConvert.convert<AuthPurchaser>(
      json['purchaser']);
  if (purchaser != null) {
    authEntity.purchaser = purchaser;
  }
  final AuthTranslator? translator = jsonConvert.convert<AuthTranslator>(
      json['translator']);
  if (translator != null) {
    authEntity.translator = translator;
  }
  final AuthServicer? servicer = jsonConvert.convert<AuthServicer>(
      json['servicer']);
  if (servicer != null) {
    authEntity.servicer = servicer;
  }
  final AuthSupplier? supplier = jsonConvert.convert<AuthSupplier>(
      json['supplier']);
  if (supplier != null) {
    authEntity.supplier = supplier;
  }
  final AuthTransportAgent? transportAgent = jsonConvert.convert<
      AuthTransportAgent>(json['transportAgent']);
  if (transportAgent != null) {
    authEntity.transportAgent = transportAgent;
  }
  final AuthPersonal? personal = jsonConvert.convert<AuthPersonal>(
      json['personal']);
  if (personal != null) {
    authEntity.personal = personal;
  }
  final AuthEnterprise? enterprise = jsonConvert.convert<AuthEnterprise>(
      json['enterprise']);
  if (enterprise != null) {
    authEntity.enterprise = enterprise;
  }
  return authEntity;
}

Map<String, dynamic> $AuthEntityToJson(AuthEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['avatar'] = entity.avatar;
  data['nickName'] = entity.nickName;
  data['phoneNumber'] = entity.phoneNumber;
  data['type'] = entity.type;
  data['authStatus'] = entity.authStatus;
  data['purchaser'] = entity.purchaser?.toJson();
  data['translator'] = entity.translator?.toJson();
  data['servicer'] = entity.servicer?.toJson();
  data['supplier'] = entity.supplier?.toJson();
  data['transportAgent'] = entity.transportAgent?.toJson();
  data['personal'] = entity.personal?.toJson();
  data['enterprise'] = entity.enterprise?.toJson();
  return data;
}

extension AuthEntityExtension on AuthEntity {
  AuthEntity copyWith({
    String? userId,
    String? avatar,
    String? nickName,
    String? phoneNumber,
    String? type,
    String? authStatus,
    AuthPurchaser? purchaser,
    AuthTranslator? translator,
    AuthServicer? servicer,
    AuthSupplier? supplier,
    AuthTransportAgent? transportAgent,
    AuthPersonal? personal,
    AuthEnterprise? enterprise,
  }) {
    return AuthEntity()
      ..userId = userId ?? this.userId
      ..avatar = avatar ?? this.avatar
      ..nickName = nickName ?? this.nickName
      ..phoneNumber = phoneNumber ?? this.phoneNumber
      ..type = type ?? this.type
      ..authStatus = authStatus ?? this.authStatus
      ..purchaser = purchaser ?? this.purchaser
      ..translator = translator ?? this.translator
      ..servicer = servicer ?? this.servicer
      ..supplier = supplier ?? this.supplier
      ..transportAgent = transportAgent ?? this.transportAgent
      ..personal = personal ?? this.personal
      ..enterprise = enterprise ?? this.enterprise;
  }
}

AuthPurchaser $AuthPurchaserFromJson(Map<String, dynamic> json) {
  final AuthPurchaser authPurchaser = AuthPurchaser();
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    authPurchaser.userId = userId;
  }
  final String? introduction = jsonConvert.convert<String>(
      json['introduction']);
  if (introduction != null) {
    authPurchaser.introduction = introduction;
  }
  final String? goodsTypeId = jsonConvert.convert<String>(json['goodsTypeId']);
  if (goodsTypeId != null) {
    authPurchaser.goodsTypeId = goodsTypeId;
  }
  final String? licenseImg = jsonConvert.convert<String>(json['licenseImg']);
  if (licenseImg != null) {
    authPurchaser.licenseImg = licenseImg;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    authPurchaser.id = id;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    authPurchaser.status = status;
  }
  return authPurchaser;
}

Map<String, dynamic> $AuthPurchaserToJson(AuthPurchaser entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['introduction'] = entity.introduction;
  data['goodsTypeId'] = entity.goodsTypeId;
  data['licenseImg'] = entity.licenseImg;
  data['id'] = entity.id;
  data['status'] = entity.status;
  return data;
}

extension AuthPurchaserExtension on AuthPurchaser {
  AuthPurchaser copyWith({
    String? userId,
    String? introduction,
    String? goodsTypeId,
    String? licenseImg,
    String? id,
    String? status,
  }) {
    return AuthPurchaser()
      ..userId = userId ?? this.userId
      ..introduction = introduction ?? this.introduction
      ..goodsTypeId = goodsTypeId ?? this.goodsTypeId
      ..licenseImg = licenseImg ?? this.licenseImg
      ..id = id ?? this.id
      ..status = status ?? this.status;
  }
}

AuthTranslator $AuthTranslatorFromJson(Map<String, dynamic> json) {
  final AuthTranslator authTranslator = AuthTranslator();
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    authTranslator.userId = userId;
  }
  final String? currentCity = jsonConvert.convert<String>(json['currentCity']);
  if (currentCity != null) {
    authTranslator.currentCity = currentCity;
  }
  final String? feeStandards = jsonConvert.convert<String>(
      json['feeStandards']);
  if (feeStandards != null) {
    authTranslator.feeStandards = feeStandards;
  }
  final String? languageAbility = jsonConvert.convert<String>(
      json['languageAbility']);
  if (languageAbility != null) {
    authTranslator.languageAbility = languageAbility;
  }
  final String? professionalScope = jsonConvert.convert<String>(
      json['professionalScope']);
  if (professionalScope != null) {
    authTranslator.professionalScope = professionalScope;
  }
  final int? translatorScore = jsonConvert.convert<int>(
      json['translatorScore']);
  if (translatorScore != null) {
    authTranslator.translatorScore = translatorScore;
  }
  final String? familiarCity = jsonConvert.convert<String>(
      json['familiarCity']);
  if (familiarCity != null) {
    authTranslator.familiarCity = familiarCity;
  }
  final String? resourceAbility = jsonConvert.convert<String>(
      json['resourceAbility']);
  if (resourceAbility != null) {
    authTranslator.resourceAbility = resourceAbility;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    authTranslator.id = id;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    authTranslator.status = status;
  }
  final String? professionalCer = jsonConvert.convert<String>(
      json['professionalCer']);
  if (professionalCer != null) {
    authTranslator.professionalCer = professionalCer;
  }
  return authTranslator;
}

Map<String, dynamic> $AuthTranslatorToJson(AuthTranslator entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['currentCity'] = entity.currentCity;
  data['feeStandards'] = entity.feeStandards;
  data['languageAbility'] = entity.languageAbility;
  data['professionalScope'] = entity.professionalScope;
  data['translatorScore'] = entity.translatorScore;
  data['familiarCity'] = entity.familiarCity;
  data['resourceAbility'] = entity.resourceAbility;
  data['id'] = entity.id;
  data['status'] = entity.status;
  data['professionalCer'] = entity.professionalCer;
  return data;
}

extension AuthTranslatorExtension on AuthTranslator {
  AuthTranslator copyWith({
    String? userId,
    String? currentCity,
    String? feeStandards,
    String? languageAbility,
    String? professionalScope,
    int? translatorScore,
    String? familiarCity,
    String? resourceAbility,
    String? id,
    String? status,
    String? professionalCer,
  }) {
    return AuthTranslator()
      ..userId = userId ?? this.userId
      ..currentCity = currentCity ?? this.currentCity
      ..feeStandards = feeStandards ?? this.feeStandards
      ..languageAbility = languageAbility ?? this.languageAbility
      ..professionalScope = professionalScope ?? this.professionalScope
      ..translatorScore = translatorScore ?? this.translatorScore
      ..familiarCity = familiarCity ?? this.familiarCity
      ..resourceAbility = resourceAbility ?? this.resourceAbility
      ..id = id ?? this.id
      ..status = status ?? this.status
      ..professionalCer = professionalCer ?? this.professionalCer;
  }
}

AuthServicer $AuthServicerFromJson(Map<String, dynamic> json) {
  final AuthServicer authServicer = AuthServicer();
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    authServicer.userId = userId;
  }
  final String? undertake = jsonConvert.convert<String>(json['undertake']);
  if (undertake != null) {
    authServicer.undertake = undertake;
  }
  final String? busLicense = jsonConvert.convert<String>(json['busLicense']);
  if (busLicense != null) {
    authServicer.busLicense = busLicense;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    authServicer.id = id;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    authServicer.status = status;
  }
  return authServicer;
}

Map<String, dynamic> $AuthServicerToJson(AuthServicer entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['undertake'] = entity.undertake;
  data['busLicense'] = entity.busLicense;
  data['id'] = entity.id;
  data['status'] = entity.status;
  return data;
}

extension AuthServicerExtension on AuthServicer {
  AuthServicer copyWith({
    String? userId,
    String? undertake,
    String? busLicense,
    String? id,
    String? status,
  }) {
    return AuthServicer()
      ..userId = userId ?? this.userId
      ..undertake = undertake ?? this.undertake
      ..busLicense = busLicense ?? this.busLicense
      ..id = id ?? this.id
      ..status = status ?? this.status;
  }
}

AuthSupplier $AuthSupplierFromJson(Map<String, dynamic> json) {
  final AuthSupplier authSupplier = AuthSupplier();
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    authSupplier.userId = userId;
  }
  final String? introduction = jsonConvert.convert<String>(
      json['introduction']);
  if (introduction != null) {
    authSupplier.introduction = introduction;
  }
  final String? headImg = jsonConvert.convert<String>(json['headImg']);
  if (headImg != null) {
    authSupplier.headImg = headImg;
  }
  final int? shipmentAreaId = jsonConvert.convert<int>(json['shipmentAreaId']);
  if (shipmentAreaId != null) {
    authSupplier.shipmentAreaId = shipmentAreaId;
  }
  final String? shipmentAreaName = jsonConvert.convert<String>(
      json['shipmentAreaName']);
  if (shipmentAreaName != null) {
    authSupplier.shipmentAreaName = shipmentAreaName;
  }
  final String? companyImg = jsonConvert.convert<String>(json['companyImg']);
  if (companyImg != null) {
    authSupplier.companyImg = companyImg;
  }
  final String? companyAvi = jsonConvert.convert<String>(json['companyAvi']);
  if (companyAvi != null) {
    authSupplier.companyAvi = companyAvi;
  }
  final String? coverArea = jsonConvert.convert<String>(json['coverArea']);
  if (coverArea != null) {
    authSupplier.coverArea = coverArea;
  }
  final String? mainBus = jsonConvert.convert<String>(json['mainBus']);
  if (mainBus != null) {
    authSupplier.mainBus = mainBus;
  }
  final int? employees = jsonConvert.convert<int>(json['employees']);
  if (employees != null) {
    authSupplier.employees = employees;
  }
  final String? headerPhone = jsonConvert.convert<String>(json['headerPhone']);
  if (headerPhone != null) {
    authSupplier.headerPhone = headerPhone;
  }
  final String? busLicense = jsonConvert.convert<String>(json['busLicense']);
  if (busLicense != null) {
    authSupplier.busLicense = busLicense;
  }
  final String? prodLicense = jsonConvert.convert<String>(json['prodLicense']);
  if (prodLicense != null) {
    authSupplier.prodLicense = prodLicense;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    authSupplier.id = id;
  }
  final String? qualifications = jsonConvert.convert<String>(
      json['qualifications']);
  if (qualifications != null) {
    authSupplier.qualifications = qualifications;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    authSupplier.status = status;
  }
  return authSupplier;
}

Map<String, dynamic> $AuthSupplierToJson(AuthSupplier entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['introduction'] = entity.introduction;
  data['headImg'] = entity.headImg;
  data['shipmentAreaId'] = entity.shipmentAreaId;
  data['shipmentAreaName'] = entity.shipmentAreaName;
  data['companyImg'] = entity.companyImg;
  data['companyAvi'] = entity.companyAvi;
  data['coverArea'] = entity.coverArea;
  data['mainBus'] = entity.mainBus;
  data['employees'] = entity.employees;
  data['headerPhone'] = entity.headerPhone;
  data['busLicense'] = entity.busLicense;
  data['prodLicense'] = entity.prodLicense;
  data['id'] = entity.id;
  data['qualifications'] = entity.qualifications;
  data['status'] = entity.status;
  return data;
}

extension AuthSupplierExtension on AuthSupplier {
  AuthSupplier copyWith({
    String? userId,
    String? introduction,
    String? headImg,
    int? shipmentAreaId,
    String? shipmentAreaName,
    String? companyImg,
    String? companyAvi,
    String? coverArea,
    String? mainBus,
    int? employees,
    String? headerPhone,
    String? busLicense,
    String? prodLicense,
    String? id,
    String? qualifications,
    String? status,
  }) {
    return AuthSupplier()
      ..userId = userId ?? this.userId
      ..introduction = introduction ?? this.introduction
      ..headImg = headImg ?? this.headImg
      ..shipmentAreaId = shipmentAreaId ?? this.shipmentAreaId
      ..shipmentAreaName = shipmentAreaName ?? this.shipmentAreaName
      ..companyImg = companyImg ?? this.companyImg
      ..companyAvi = companyAvi ?? this.companyAvi
      ..coverArea = coverArea ?? this.coverArea
      ..mainBus = mainBus ?? this.mainBus
      ..employees = employees ?? this.employees
      ..headerPhone = headerPhone ?? this.headerPhone
      ..busLicense = busLicense ?? this.busLicense
      ..prodLicense = prodLicense ?? this.prodLicense
      ..id = id ?? this.id
      ..qualifications = qualifications ?? this.qualifications
      ..status = status ?? this.status;
  }
}

AuthTransportAgent $AuthTransportAgentFromJson(Map<String, dynamic> json) {
  final AuthTransportAgent authTransportAgent = AuthTransportAgent();
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    authTransportAgent.userId = userId;
  }
  final String? companyImg = jsonConvert.convert<String>(json['companyImg']);
  if (companyImg != null) {
    authTransportAgent.companyImg = companyImg;
  }
  final String? companyAvi = jsonConvert.convert<String>(json['companyAvi']);
  if (companyAvi != null) {
    authTransportAgent.companyAvi = companyAvi;
  }
  final String? introduction = jsonConvert.convert<String>(
      json['introduction']);
  if (introduction != null) {
    authTransportAgent.introduction = introduction;
  }
  final int? routeStart = jsonConvert.convert<int>(json['routeStart']);
  if (routeStart != null) {
    authTransportAgent.routeStart = routeStart;
  }
  final int? routeEnd = jsonConvert.convert<int>(json['routeEnd']);
  if (routeEnd != null) {
    authTransportAgent.routeEnd = routeEnd;
  }
  final String? serviceItem = jsonConvert.convert<String>(json['serviceItem']);
  if (serviceItem != null) {
    authTransportAgent.serviceItem = serviceItem;
  }
  final String? serviceMemo = jsonConvert.convert<String>(json['serviceMemo']);
  if (serviceMemo != null) {
    authTransportAgent.serviceMemo = serviceMemo;
  }
  final String? feeImg = jsonConvert.convert<String>(json['feeImg']);
  if (feeImg != null) {
    authTransportAgent.feeImg = feeImg;
  }
  final String? protection = jsonConvert.convert<String>(json['protection']);
  if (protection != null) {
    authTransportAgent.protection = protection;
  }
  final String? busLicense = jsonConvert.convert<String>(json['busLicense']);
  if (busLicense != null) {
    authTransportAgent.busLicense = busLicense;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    authTransportAgent.id = id;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    authTransportAgent.status = status;
  }
  final List<
      TransportAgentTask>? transportAgentTask = (json['transportAgentTask'] as List<
      dynamic>?)
      ?.map(
          (e) =>
      jsonConvert.convert<TransportAgentTask>(e) as TransportAgentTask)
      .toList();
  if (transportAgentTask != null) {
    authTransportAgent.transportAgentTask = transportAgentTask;
  }
  return authTransportAgent;
}

Map<String, dynamic> $AuthTransportAgentToJson(AuthTransportAgent entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['companyImg'] = entity.companyImg;
  data['companyAvi'] = entity.companyAvi;
  data['introduction'] = entity.introduction;
  data['routeStart'] = entity.routeStart;
  data['routeEnd'] = entity.routeEnd;
  data['serviceItem'] = entity.serviceItem;
  data['serviceMemo'] = entity.serviceMemo;
  data['feeImg'] = entity.feeImg;
  data['protection'] = entity.protection;
  data['busLicense'] = entity.busLicense;
  data['id'] = entity.id;
  data['status'] = entity.status;
  data['transportAgentTask'] =
      entity.transportAgentTask.map((v) => v.toJson()).toList();
  return data;
}

extension AuthTransportAgentExtension on AuthTransportAgent {
  AuthTransportAgent copyWith({
    String? userId,
    String? companyImg,
    String? companyAvi,
    String? introduction,
    int? routeStart,
    int? routeEnd,
    String? serviceItem,
    String? serviceMemo,
    String? feeImg,
    String? protection,
    String? busLicense,
    String? id,
    String? status,
    List<TransportAgentTask>? transportAgentTask,
  }) {
    return AuthTransportAgent()
      ..userId = userId ?? this.userId
      ..companyImg = companyImg ?? this.companyImg
      ..companyAvi = companyAvi ?? this.companyAvi
      ..introduction = introduction ?? this.introduction
      ..routeStart = routeStart ?? this.routeStart
      ..routeEnd = routeEnd ?? this.routeEnd
      ..serviceItem = serviceItem ?? this.serviceItem
      ..serviceMemo = serviceMemo ?? this.serviceMemo
      ..feeImg = feeImg ?? this.feeImg
      ..protection = protection ?? this.protection
      ..busLicense = busLicense ?? this.busLicense
      ..id = id ?? this.id
      ..status = status ?? this.status
      ..transportAgentTask = transportAgentTask ?? this.transportAgentTask;
  }
}

AuthPersonal $AuthPersonalFromJson(Map<String, dynamic> json) {
  final AuthPersonal authPersonal = AuthPersonal();
  final String? fullName = jsonConvert.convert<String>(json['fullName']);
  if (fullName != null) {
    authPersonal.fullName = fullName;
  }
  final String? idNumber = jsonConvert.convert<String>(json['idNumber']);
  if (idNumber != null) {
    authPersonal.idNumber = idNumber;
  }
  final String? idPhotoFront = jsonConvert.convert<String>(
      json['idPhotoFront']);
  if (idPhotoFront != null) {
    authPersonal.idPhotoFront = idPhotoFront;
  }
  final String? idPhotoBack = jsonConvert.convert<String>(json['idPhotoBack']);
  if (idPhotoBack != null) {
    authPersonal.idPhotoBack = idPhotoBack;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    authPersonal.id = id;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    authPersonal.status = status;
  }
  return authPersonal;
}

Map<String, dynamic> $AuthPersonalToJson(AuthPersonal entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['fullName'] = entity.fullName;
  data['idNumber'] = entity.idNumber;
  data['idPhotoFront'] = entity.idPhotoFront;
  data['idPhotoBack'] = entity.idPhotoBack;
  data['id'] = entity.id;
  data['status'] = entity.status;
  return data;
}

extension AuthPersonalExtension on AuthPersonal {
  AuthPersonal copyWith({
    String? fullName,
    String? idNumber,
    String? idPhotoFront,
    String? idPhotoBack,
    String? id,
    String? status,
  }) {
    return AuthPersonal()
      ..fullName = fullName ?? this.fullName
      ..idNumber = idNumber ?? this.idNumber
      ..idPhotoFront = idPhotoFront ?? this.idPhotoFront
      ..idPhotoBack = idPhotoBack ?? this.idPhotoBack
      ..id = id ?? this.id
      ..status = status ?? this.status;
  }
}

AuthEnterprise $AuthEnterpriseFromJson(Map<String, dynamic> json) {
  final AuthEnterprise authEnterprise = AuthEnterprise();
  final String? entName = jsonConvert.convert<String>(json['entName']);
  if (entName != null) {
    authEnterprise.entName = entName;
  }
  final String? licenseNumber = jsonConvert.convert<String>(
      json['licenseNumber']);
  if (licenseNumber != null) {
    authEnterprise.licenseNumber = licenseNumber;
  }
  final String? licensePhoto = jsonConvert.convert<String>(
      json['licensePhoto']);
  if (licensePhoto != null) {
    authEnterprise.licensePhoto = licensePhoto;
  }
  final String? address = jsonConvert.convert<String>(json['address']);
  if (address != null) {
    authEnterprise.address = address;
  }
  final String? legalPerson = jsonConvert.convert<String>(json['legalPerson']);
  if (legalPerson != null) {
    authEnterprise.legalPerson = legalPerson;
  }
  final String? legalIdNumber = jsonConvert.convert<String>(
      json['legalIdNumber']);
  if (legalIdNumber != null) {
    authEnterprise.legalIdNumber = legalIdNumber;
  }
  final String? legalIdPhotoFront = jsonConvert.convert<String>(
      json['legalIdPhotoFront']);
  if (legalIdPhotoFront != null) {
    authEnterprise.legalIdPhotoFront = legalIdPhotoFront;
  }
  final String? legalIdPhotoBack = jsonConvert.convert<String>(
      json['legalIdPhotoBack']);
  if (legalIdPhotoBack != null) {
    authEnterprise.legalIdPhotoBack = legalIdPhotoBack;
  }
  final String? bankName = jsonConvert.convert<String>(json['bankName']);
  if (bankName != null) {
    authEnterprise.bankName = bankName;
  }
  final String? bankAccountName = jsonConvert.convert<String>(
      json['bankAccountName']);
  if (bankAccountName != null) {
    authEnterprise.bankAccountName = bankAccountName;
  }
  final String? bankAccountNumber = jsonConvert.convert<String>(
      json['bankAccountNumber']);
  if (bankAccountNumber != null) {
    authEnterprise.bankAccountNumber = bankAccountNumber;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    authEnterprise.id = id;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    authEnterprise.status = status;
  }
  return authEnterprise;
}

Map<String, dynamic> $AuthEnterpriseToJson(AuthEnterprise entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['entName'] = entity.entName;
  data['licenseNumber'] = entity.licenseNumber;
  data['licensePhoto'] = entity.licensePhoto;
  data['address'] = entity.address;
  data['legalPerson'] = entity.legalPerson;
  data['legalIdNumber'] = entity.legalIdNumber;
  data['legalIdPhotoFront'] = entity.legalIdPhotoFront;
  data['legalIdPhotoBack'] = entity.legalIdPhotoBack;
  data['bankName'] = entity.bankName;
  data['bankAccountName'] = entity.bankAccountName;
  data['bankAccountNumber'] = entity.bankAccountNumber;
  data['id'] = entity.id;
  data['status'] = entity.status;
  return data;
}

extension AuthEnterpriseExtension on AuthEnterprise {
  AuthEnterprise copyWith({
    String? entName,
    String? licenseNumber,
    String? licensePhoto,
    String? address,
    String? legalPerson,
    String? legalIdNumber,
    String? legalIdPhotoFront,
    String? legalIdPhotoBack,
    String? bankName,
    String? bankAccountName,
    String? bankAccountNumber,
    String? id,
    String? status,
  }) {
    return AuthEnterprise()
      ..entName = entName ?? this.entName
      ..licenseNumber = licenseNumber ?? this.licenseNumber
      ..licensePhoto = licensePhoto ?? this.licensePhoto
      ..address = address ?? this.address
      ..legalPerson = legalPerson ?? this.legalPerson
      ..legalIdNumber = legalIdNumber ?? this.legalIdNumber
      ..legalIdPhotoFront = legalIdPhotoFront ?? this.legalIdPhotoFront
      ..legalIdPhotoBack = legalIdPhotoBack ?? this.legalIdPhotoBack
      ..bankName = bankName ?? this.bankName
      ..bankAccountName = bankAccountName ?? this.bankAccountName
      ..bankAccountNumber = bankAccountNumber ?? this.bankAccountNumber
      ..id = id ?? this.id
      ..status = status ?? this.status;
  }
}

TransportAgentTask $TransportAgentTaskFromJson(Map<String, dynamic> json) {
  final TransportAgentTask transportAgentTask = TransportAgentTask();
  final String? startPoint = jsonConvert.convert<String>(json['startPoint']);
  if (startPoint != null) {
    transportAgentTask.startPoint = startPoint;
  }
  final String? endPoint = jsonConvert.convert<String>(json['endPoint']);
  if (endPoint != null) {
    transportAgentTask.endPoint = endPoint;
  }
  return transportAgentTask;
}

Map<String, dynamic> $TransportAgentTaskToJson(TransportAgentTask entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['startPoint'] = entity.startPoint;
  data['endPoint'] = entity.endPoint;
  return data;
}

extension TransportAgentTaskExtension on TransportAgentTask {
  TransportAgentTask copyWith({
    String? startPoint,
    String? endPoint,
  }) {
    return TransportAgentTask()
      ..startPoint = startPoint ?? this.startPoint
      ..endPoint = endPoint ?? this.endPoint;
  }
}